Optimal. Leaf size=56 \[ \frac{a^2 \sin (e+f x)}{f}+\frac{b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0673528, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {4147, 390, 385, 206} \[ \frac{a^2 \sin (e+f x)}{f}+\frac{b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4147
Rule 390
Rule 385
Rule 206
Rubi steps
\begin{align*} \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b-a x^2\right )^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (a^2+\frac{b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{a^2 \sin (e+f x)}{f}+\frac{\operatorname{Subst}\left (\int \frac{b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{a^2 \sin (e+f x)}{f}+\frac{b^2 \sec (e+f x) \tan (e+f x)}{2 f}+\frac{(b (4 a+b)) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{2 f}\\ &=\frac{b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{a^2 \sin (e+f x)}{f}+\frac{b^2 \sec (e+f x) \tan (e+f x)}{2 f}\\ \end{align*}
Mathematica [A] time = 0.0333472, size = 80, normalized size = 1.43 \[ \frac{a^2 \sin (e) \cos (f x)}{f}+\frac{a^2 \cos (e) \sin (f x)}{f}+\frac{2 a b \tanh ^{-1}(\sin (e+f x))}{f}+\frac{b^2 \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.055, size = 78, normalized size = 1.4 \begin{align*}{\frac{{a}^{2}\sin \left ( fx+e \right ) }{f}}+2\,{\frac{ab\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{f}}+{\frac{{b}^{2}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{2\,f}}+{\frac{{b}^{2}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{2\,f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.00985, size = 117, normalized size = 2.09 \begin{align*} -\frac{b^{2}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a b{\left (\log \left (\sin \left (f x + e\right ) + 1\right ) - \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a^{2} \sin \left (f x + e\right )}{4 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.515399, size = 239, normalized size = 4.27 \begin{align*} \frac{{\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) -{\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \,{\left (2 \, a^{2} \cos \left (f x + e\right )^{2} + b^{2}\right )} \sin \left (f x + e\right )}{4 \, f \cos \left (f x + e\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.19094, size = 113, normalized size = 2.02 \begin{align*} \frac{4 \, a^{2} \sin \left (f x + e\right ) +{\left (4 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) -{\left (4 \, a b + b^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - \frac{2 \, b^{2} \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1}}{4 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]